{|if $errors|}
    {|foreach from=$errors item=e|}
        {|if $e == 'title'|}Заповніть поле "Заголовок"<br />{|/if|}
        {|if $e == 'content'|}Заповніть поле "Текст"<br />{|/if|}
        {|if $e == 'url'|}Заповніть поле "URL"<br />{|/if|}
    {|/foreach|}
{|/if|}
{|if $message == 'ok'|}
    <script type="text/javascript">window.location = "/controlpanel/staticpages/"</script>
{|/if|}
{|if $message != 'ok'|}

    <script language="JavaScript"> 
        function countit(what){ 
            formcontent=what.value;
            txt="/staticpages/"+formcontent+"/";  
            if( document.getElementById  && (elem=document.getElementById("lin")) )
             {
              if( !elem.firstChild )
               elem.appendChild( document.createTextNode( txt ) );
              else 
               elem.firstChild.data = txt;
             }

 
        } 
    </script>  
<form method="post">
    <table class="utable">
        <tr>
            <td class="lef">Заголовок: </td>
            <td>
                <input type="text" style=" width:100%;"  name="title" value="{|$control_title|}" />
            </td>
        </tr>
        <tr>
            <td class="lef">Текст: </td>
            <td>
                <textarea id="pcontent" style=" height:300px; width:100%;" name="content">{|$control_content|}</textarea>
                <script type="text/javascript" src="/packages/CKEditor/ckeditor/ckeditor.js"></script>
                <script type="text/javascript">
                    CKEDITOR.replace('pcontent', {
                        filebrowserBrowseUrl : '/packages/CKFinder/ckfinder/ckfinder.html',
                	    filebrowserImageBrowseUrl : '/packages/CKFinder/ckfinder/ckfinder.html?Type=Images',
                        filebrowserFlashBrowseUrl : '/packages/CKFinder/ckfinder/ckfinder.html?Type=Flash',
                        filebrowserUploadUrl : '/packages/CKFinder/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
                        filebrowserImageUploadUrl : '/packages/CKFinder/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
                        filebrowserFlashUploadUrl : '/packages/CKFinder/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
                    });
                </script>
            </td>
        </tr>
        <tr>
            <tdclass="lef">URL: </td>
        </tr>
            
        <tr>
               <td class="lef">URL: </td>
               <td><input type="text" name="url" style=" width:100%;" value="{|$control_url|}" onKeyUp="countit(this)" /> </td>
        </tr>   
       
        <tr>
            <td>  Посилання на статичну сторінку:</td> 
            <td>   <label id="lin"></label>     </td>
        </tr>
       
        
    </table>
    <input type="submit" class="button" name="add" value="Додати" />
</form>
{|/if|}